<?=$this->load->view('include_header',null)?>
<style type="text/css">
form#form textarea {
    height: 50px;
    overflow: auto;
    padding: 5px;
    width: 410px;
}
</style>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/za_update/'.$cateid)?>">

	<h3>南非申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  
		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />
			</td>
        </tr>
    </tfoot>

    <tbody>
	    <tr class="odd">
            <td colspan="5" align="center"><strong>Failure to complete this application form in full may result in the visa being delayed or refused.<br/>
Please use block letters and black ink only.</strong></td>
        </tr>
	    <tr class="even">
            <td colspan="5"><strong>PERSONAL PARTICULARS</strong></td>
        </tr>
        <tr class="odd">
            <td>Surname</td>
            <td><input type="text" name="surname" value="<?= @$info->surname?>" /></td>
            <td>&nbsp;</td>
            <td>First names (in full)</td>
            <td><input type="text" name="firstname" value="<?= @$info->firstname?>" /></td>
        </tr>
        <tr class="even">
            <td>Maiden name</td>
            <td><input type="text" name="maidenname" value="<?= @$info->maidenname?>" /></td>
            <td>&nbsp;</td>
            <td>Previous surname(s)</td>
            <td><input type="text" name="pre_surname" value="<?= @$info->pre_surname?>" /></td>
        </tr>
        <tr class="odd">
            <td>Date of birth</td>
            <td nowrap="nowrap">
			<select name="birth_y"><?php for($i=date("Y");$i>1940;$i--) echo "<option value='$i'".((@$info->birth_y==$i)?"selected":"").">$i</option>"; ?></select>-
			<select name="birth_m"><?php for($i=1;$i<=12;$i++) echo "<option value='$i'".((@$info->birth_m==$i)?"selected":"").">$i</option>"; ?></select>-
			<select name="birth_d"><?php for($i=1;$i<=31;$i++) echo "<option value='$i'".((@$info->birth_d==$i)?"selected":"").">$i</option>"; ?></select>
			</td>
            <td>&nbsp;</td>
            <td>City of birth </td>
            <td><input type="text" name="birth_city" value="<?= @$info->birth_city?>" /></td>
        </tr>
        <tr class="even">
            <td>Country of birth</td>
            <td><input type="text" name="birth_country" value="<?= @$info->birth_country?>" /></td>
            <td>&nbsp;</td>
            <td>Gender</td>
            <td><input type="radio" name="sex" value="1" <?= (@$info->sex==1)?'checked':''?> />
            Male  
              <input type="radio" name="sex" value="2" <?= (@$info->sex==2)?'checked':''?> />
              Female </td>
        </tr>
        <tr class="odd">
            <td>Nationality</td>
            <td><input type="text" name="cur_nationality" value="<?= @$info->cur_nationality?>" /></td>
			<td>&nbsp;</td>
			<td>If acquired by naturalisation, state original nationality</td>
			<td><input type="text" name="ori_nationality" value="<?= @$info->ori_nationality?>" /></td>
        </tr>
        <tr class="even">
          <td>Where and when was present nationality obtained</td>
		  <td colspan="4"><input type="text" name="obtain_nationality" value="<?= @$info->obtain_nationality?>" style="width:300px"/></td>
        </tr>
        <tr class="odd">
            <td>Passport/Travel Document Number</td>
			<td colspan="4"><input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /></td>
        </tr>
        <tr class="even">
            <td>Type of document</td>
            <td colspan="4">
<input type="radio" name="travel_document_type" value="1" <?= (@$info->travel_document_type==1)?'checked':''?>/>Diplomatic
<input type="radio" name="travel_document_type" value="2" <?= (@$info->travel_document_type==2)?'checked':''?>/>Official
<input type="radio" name="travel_document_type" value="3" <?= (@$info->travel_document_type==3)?'checked':''?>/>Ordinary Passport 
<input type="radio" name="travel_document_type" value="4" <?= (@$info->travel_document_type==4)?'checked':''?>/>Travel Document<br />
<input type="radio" name="travel_document_type" value="5" <?= (@$info->travel_document_type==5)?'checked':''?>/>other (Specify)
<input type="text" name="travel_document_type_other" value="<?= @$info->travel_document_type_other?>" /></td>
        </tr>
        <tr class="odd">
            <td>Issuing authority</td>
            <td><input type="text" name="travel_document_issue_by" value="<?= @$info->travel_document_issue_by?>" /></td>
            <td>&nbsp;</td>
            <td>Date of expiry</td>
            <td><input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /></td>
        </tr>
        <tr class="even">
            <td>Permanent residential address</td>
            <td colspan="4"><input name="permanent_address" type="text" value="<?= @$info->permanent_address?>" style="width:300px" /></td>
        </tr>
		        <tr class="odd">
            <td>Period resident at this address</td>
            <td colspan="4"><input name="period_address" type="text" value="<?= @$info->period_address?>" style="width:300px" /></td>
        </tr>
        <tr class="even">
            <td>Telephone number</td>
            <td><input type="text" name="tel_code" value="<?= @$info->tel_code?>" />
              (code)<br /><input type="text" name="tel_num" value="<?= @$info->tel_num?>" />  (number)</td>
            <td>&nbsp;</td>
            <td>Country of permanent residence</td>
            <td><input type="text" name="permanent_country" value="<?= @$info->permanent_country?>" /></td>
        </tr>		
        <tr class="odd">
            <td>Period resident in that country</td>
			<td><input type="text" name="period_country" value="<?= @$info->period_country?>" /></td>
			<td>&nbsp;</td>
			<td>Occupation or profession</td>
			<td><input type="text" name="occupation" value="<?= @$info->occupation?>" /></td>
        </tr>
        <tr class="even">
            <td>Name, address and telephone no. of employer, university, organisation, etc. to which you are attached, or<br />
              that you attend or which you represent</td>
            <td colspan="4"><textarea name="employer_detail"><?= @$info->employer_detail?></textarea></td>
        </tr>
        <tr class="odd">
            <td>If self-employed, state name, address, telephone no. and nature of business</td>
            <td colspan="4"><textarea name="selfemployed_detail"><?= @$info->selfemployed_detail?></textarea></td>
        </tr>
        <tr class="even">
            <td>Marital status</td>
            <td colspan="4">
			<input type="radio" name="marital_status" value="1" <?= (@$info->marital_status==1)?'checked':''?>/>Never married&nbsp;		
            <input type="radio" name="marital_status" value="2" <?= (@$info->marital_status==2)?'checked':''?>/>Married&nbsp;
            <input type="radio" name="marital_status" value="3" <?= (@$info->marital_status==3)?'checked':''?>/>Widowed ;		
            <input type="radio" name="marital_status" value="4" <?= (@$info->marital_status==4)?'checked':''?>/>Separated&nbsp;
			<input type="radio" name="marital_status" value="5" <?= (@$info->marital_status==5)?'checked':''?>/>Divorced</td>
        </tr>

        <tr class="odd">
            <td>First name(s) of spouse</td>
            <td><input type="text" name="spouse_firstname" value="<?= @$info->spouse_firstname?>" /></td>
            <td>&nbsp;</td>
            <td>Maiden name</td>
            <td><input type="text" name="spouse_maidenname" value="<?= @$info->spouse_maidenname?>" /></td>
        </tr>
        <tr class="even">
            <td>Date of birth</td>
            <td><input type="text" name="spouse_birth" value="<?= @$info->spouse_birth?>" id="spouse_birth" /></td>
            <td>&nbsp;</td>
            <td>Nationality</td>
            <td><input type="text" name="spouse_nationality" value="<?= @$info->spouse_nationality?>" /></td>
        </tr>
        <tr class="odd">
            <td colspan="5" align="center"><strong>NB: SEPARATE FORMS MUST BE COMPLETED IN RESPECT OF PERSONS OVER THE AGE OF 16<br/>
AND CHILDREN UNDER THE AGE OF 16 TRAVELLING ON THEIR OWN PASSPORTS</strong></td>
        </tr>
        <tr class="even">
            <td colspan="5">Particulars of children endorsed on your passport accompanying you:<br/>
			1. Surname<input type="text" name="child1_surname" value="<?= @$info->child1_surname?>" />  First name(s)<input type="text" name="child1_firstname" value="<?= @$info->child1_firstname?>" /> Date of birth<input type="text" name="child1_birth" value="<?= @$info->child1_birth?>" id="child1_birth" /> Place of birth <input type="text" name="child1_birth_place" value="<?= @$info->child1_birth_place?>" /><br/>
			2. Surname<input type="text" name="child2_surname" value="<?= @$info->child2_surname?>" />  First name(s)<input type="text" name="child2_firstname" value="<?= @$info->child2_firstname?>" /> Date of birth<input type="text" name="child2_birth" value="<?= @$info->child2_birth?>" id="child2_birth" /> Place of birth <input type="text" name="child2_birth_place" value="<?= @$info->child2_birth_place?>" /><br/>
			3. Surname<input type="text" name="child3_surname" value="<?= @$info->child3_surname?>" />  First name(s)<input type="text" name="child3_firstname" value="<?= @$info->child3_firstname?>" /> Date of birth<input type="text" name="child3_birth" value="<?= @$info->child3_birth?>" id="child3_birth" /> Place of birth <input type="text" name="child3_birth_place" value="<?= @$info->child3_birth_place?>" /><br/>
			4. Surname<input type="text" name="child4_surname" value="<?= @$info->child4_surname?>" />  First name(s)<input type="text" name="child4_firstname" value="<?= @$info->child4_firstname?>" /> Date of birth<input type="text" name="child4_birth" value="<?= @$info->child4_birth?>" id="child4_birth" /> Place of birth <input type="text" name="child4_birth_place" value="<?= @$info->child4_birth_place?>" /><br/></td>
            
        </tr>
        <tr class="odd">
            <td colspan="5"><strong>VISIT TO SOUTH AFRICA</strong></td>
        </tr>
        <tr class="even">
            <td>Expected date of arrival in the Republic</td>
            <td>Y 
              <input name="arrival_y" type="text" value="<?= @$info->arrival_y?>" style="width:30px" />
              M
              <input name="arrival_m" type="text" value="<?= @$info->arrival_m?>" style="width:15px" />  
              D 
              <input name="arrival_d" type="text" value="<?= @$info->arrival_d?>" style="width:15px"/></td>
            <td>&nbsp;</td>
            <td>Place of arrival</td>
            <td><input type="text" name="arrival_place" value="<?= @$info->arrival_place?>"/></td>
        </tr>
        <tr class="odd">
            <td>Purpose of visit</td>
			<td><input type="text" name="visit_purpose" value="<?= @$info->visit_purpose?>" /></td>
			<td>&nbsp;</td>
			<td>Duration of stay (months, weeks or days)</td>
			<td><input type="text" name="stay_duration" value="<?= @$info->stay_duration?>" /></td>
        </tr>
        <tr class="even">
            <td>Number of entries required</td>
            <td colspan="4">
			<input type="radio" name="enty_num" value="1" <?= (@$info->enty_num==1)?'checked':''?>/> Single 
            <input type="radio" name="enty_num" value="2" <?= (@$info->enty_num==2)?'checked':''?>/> Multiple
            <input type="radio" name="enty_num" value="3" <?= (@$info->enty_num==3)?'checked':''?>/> Two </td>
        </tr>
        <tr class="odd">
            <td>Proposed residential address (physical) in the Republic, including the full name(s) of your host or hotel</td>
            <td colspan="4"><textarea name="proposed_address"><?= @$info->proposed_address?></textarea></td>
        </tr>
        <tr class="even">
            <td colspan="5">Names of organisations or persons you will be contacting during your stay in the Republic:<br/>
			Name <input type="text" name="contacter1_name" value="<?= @$info->contacter1_name?>" />&nbsp;Address<input type="text" name="contacter1_address" value="<?= @$info->contacter1_address?>" style="width:300px" />&nbsp;Relationship<input type="text" name="contacter1_relation" value="<?= @$info->contacter1_relation?>" /><br/>
            Name <input type="text" name="contacter2_name" value="<?= @$info->contacter2_name?>" />&nbsp;Address<input type="text" name="contacter2_address" value="<?= @$info->contacter2_address?>" style="width:300px" />&nbsp;Relationship<input type="text" name="contacter2_relation" value="<?= @$info->contacter2_relation?>" /><br/>
            Name <input type="text" name="contacter3_name" value="<?= @$info->contacter3_name?>" />&nbsp;Address<input type="text" name="contacter3_address" value="<?= @$info->contacter3_address?>" style="width:300px" />&nbsp;Relationship<input type="text" name="contacter3_relation" value="<?= @$info->contacter3_relation?>" /><br/>
			Name <input type="text" name="contacter4_name" value="<?= @$info->contacter4_name?>" />&nbsp;Address<input type="text" name="contacter4_address" value="<?= @$info->contacter4_address?>" style="width:300px" />&nbsp;Relationship<input type="text" name="contacter4_relation" value="<?= @$info->contacter4_relation?>" /><br/>
           </td>
        </tr>
        <tr class="odd">
            <td>Identity document number or permanent residence permit number of South African host</td>
            <td colspan="4"><input type="text" name="host_id" value="<?= @$info->host_id?>" style="width:300px" /></td>
        </tr>
        <tr class="even">
            <td colspan="5"><strong>Indicate by means of an X whichever is applicable</strong></td>
        </tr>
        <tr class="odd">
            <td colspan="5">Have you at any time applied for a permit to settle permanently in South Africa?  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="is_q1" value="1" <?= (@$info->is_q1==1)?'checked':''?>/> 
            Yes 
&nbsp;&nbsp;
<input type="radio" name="is_q1" value="0" <?= (@$info->is_q1==0)?'checked':''?>/> 
No</td>
        </tr>
        <tr class="even">
            <td colspan="5">Have you ever been restricted or refused entry into South Africa?  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="is_q2" value="1" <?= (@$info->is_q2==1)?'checked':''?>/> 
            Yes 
&nbsp;&nbsp;
<input type="radio" name="is_q2" value="0" <?= (@$info->is_q2==0)?'checked':''?>/> 
No</td>
        </tr>
        <tr class="odd">
            <td colspan="5">Have you ever been deported from or ordered to leave South Africa?  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="is_q3" value="1" <?= (@$info->is_q3==1)?'checked':''?>/> 
            Yes 
&nbsp;&nbsp;
<input type="radio" name="is_q3" value="0" <?= (@$info->is_q3==0)?'checked':''?>/> 
No</td>
        </tr>
        <tr class="even">
            <td colspan="5">Have you ever been convicted of any crime in any country?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="is_q4" value="1" <?= (@$info->is_q4==1)?'checked':''?>/> 
            Yes 
&nbsp;&nbsp;
<input type="radio" name="is_q4" value="0" <?= (@$info->is_q4==0)?'checked':''?>/> 
No</td>
        </tr>
        <tr class="odd">
             <td colspan="5">Is a criminal action pending against you in any country?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="is_q5" value="1" <?= (@$info->is_q5==1)?'checked':''?>/> 
            Yes 
&nbsp;&nbsp;
<input type="radio" name="is_q5" value="0" <?= (@$info->is_q5==0)?'checked':''?>/> 
No</td>
        </tr>
        <tr class="even">
            <td colspan="5">Are you an unrehabilitated insolvent?  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="is_q6" value="1" <?= (@$info->is_q6==1)?'checked':''?>/> 
            Yes 
&nbsp;&nbsp;
<input type="radio" name="is_q6" value="0" <?= (@$info->is_q6==0)?'checked':''?>/> 
No</td>
        </tr>
        <tr class="odd">
            <td colspan="5">Are you suffering from tuberculosis or any other infectious or contagious disease or anymental or physical deficiency?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="is_q7" value="1" <?= (@$info->is_q7==1)?'checked':''?>/> 
            Yes 
&nbsp;&nbsp;
<input type="radio" name="is_q7" value="0" <?= (@$info->is_q7==0)?'checked':''?>/> 
No</td>
        </tr>
		<tr class="even">
            <td colspan="5">Have you ever been judicially declared incompetent?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="is_q8" value="1" <?= (@$info->is_q8==1)?'checked':''?>/> 
            Yes 
&nbsp;&nbsp;
<input type="radio" name="is_q8" value="0" <?= (@$info->is_q8==0)?'checked':''?>/> 
No</td>
        </tr>
        <tr class="odd">
            <td colspan="5">Are you a member of, or adherent to an association or organisation advocating the practice of social violence or racial hatred or are you or have you been a member of an<br />
              organisation or association utilising crime or terrorism to pursue its ends?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="is_q9" value="1" <?= (@$info->is_q9==1)?'checked':''?>/> 
            Yes 
&nbsp;&nbsp;
<input type="radio" name="is_q9" value="0" <?= (@$info->is_q9==0)?'checked':''?>/> 
No</td>
        </tr>
		<tr class="even">
		  <td>Give particulars if reply to one or more of the questions above is in the affirmative</td>
		  <td colspan="4"><textarea name="q_detail"><?= @$info->q_detail?></textarea></td>
		</tr>
		
		<tr class="odd">
		  <td colspan="5"><strong>To be completed by applicants applying for visitor’s permits exceeding three months:</strong><br />
		    <br />
			In the case of a spouse or dependant minor child of the holder of a permit issued in terms of sections 11, 13,14, 15, 17, 19 or 22,submission of a marriage certificate or an unabridged birth certificate.<br/>
			Proof of academic sabbatical, if applicable.<br/>
			Proof of non-remunerative voluntary or charitable activities to be undertaken, if applicable.<br/>
			Proof of research to be undertaken, if applicable.<br/>
			Proof of funds available for subsistence during period of visit.</td>
		</tr>
		
		<tr class="even">
		  <td colspan="5"><strong>To be completed by applicants applying for diplomatic, official or courtesy visas:</strong><br/>
		  In the case of an official visit, submission of a note verbale.<br/>
		  In the case of a diplomatic placing in the Republic, proof of such placing.
		  </td>
		</tr>
		
		<tr class="odd">
		  <td colspan="5"><strong>To be completed only by passengers in transit to another country:</strong><br/>
		  Destination after leaving the Republic<input name="leaving_destination" type="text" value="<?= @$info->leaving_destination?>" style="width:300px" />
		  <br />
		  Mode of travel to destination
		  <input name="travel_mode" type="text" value="<?= @$info->travel_mode?>" style="width:300px" />
		  <br />
		  Intended date and port of departure from the Republic to that destination
		  <input name="departure_destination" type="text" value="<?= @$info->departure_destination?>" style="width:300px" />
		  <br />
		  Do you hold a visa or permit for temporary or permanent residence in the country of your destination? (Proof must be submitted) <br />
		  <input type="text" name="destination_permit" value="<?= @$info->destination_permit?>" style="width:500px" /></td>
		</tr>
		<tr class="even">
		<td colspan="5"><strong>To be completed by persons wishing to work in the Republic  &nbsp;&nbsp; 
		  <input type="radio" name="is_work" value="1" <?= (@$info->is_work==1)?'checked':''?>/>
Yes 
&nbsp;&nbsp;
<input type="radio" name="is_work" value="0" <?= (@$info->is_work==0)?'checked':''?>/>
No<br />
		</strong>If the answer is yes, please provide details
		  <textarea name="work_detail"><?= @$info->work_detail?></textarea></td>
		</tr>
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		surname:"required",
		firstname:"required",
		cur_nationality:"required",
		travel_document_num:"required",
		travel_document_type:"required",
		travel_document_issue_by:"required",
		travel_document_valid_date:"required",
		marital_status:"required",
		enty_num:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'yy/mm/dd',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#travel_document_valid_date").datepicker();
	$("#spouse_birth").datepicker();
	$("#child1_birth").datepicker();
	$("#child2_birth").datepicker();
	$("#child3_birth").datepicker();
	$("#child4_birth").datepicker();
	

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>